﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Auth_LocaisArmazenagem : System.Web.UI.UserControl, IViewStatePersist
{
	protected void Page_Load(object sender, EventArgs e)
	{

	}
	protected void Page_PreRender(object sender, EventArgs e)
	{
		this.lvEstoque.Visible = this.lvLocalArmazenagem.SelectedIndex != -1;
	}
	protected void lvLocalArmazenagem_ItemInserting(object sender, ListViewInsertEventArgs e)
	{
		DropDownList UsuarioIdDropDownList = e.Item.FindControl("UsuarioIdDropDownList") as DropDownList;
		e.Values["UsuarioId"] = UsuarioIdDropDownList.SelectedValue;
	}
	protected void lvLocalArmazenagem_ItemEditing(object sender, ListViewEditEventArgs e)
	{
		this.lvLocalArmazenagem.SelectedIndex = e.NewEditIndex;
	}
	protected void lvLocalArmazenagem_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
	{
		if (e.NewSelectedIndex != this.lvLocalArmazenagem.EditIndex)
		{
			this.lvLocalArmazenagem.EditIndex = -1;
		}
	}
	protected void lvEstoque_ItemInserting(object sender, ListViewInsertEventArgs e)
	{
		DropDownList AtivoIdDropDownList = e.Item.FindControl("AtivoIdDropDownList") as DropDownList;
		e.Values["AtivoId"] = AtivoIdDropDownList.SelectedValue;
		e.Values["LocalArmazenagemId"] = this.lvLocalArmazenagem.SelectedValue;
	}

	#region IViewStatePersist Members

	public new object SaveViewState()
	{
		return base.SaveViewState();
	}

	public new void LoadViewState(object savedState)
	{
		base.LoadViewState(savedState);
	}

	#endregion
}
